/**
 * createor: zc
 * email: zc8023zs@163.com
 * create_time: 2020/3/14 13:46:24
 */
import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/system/sysuser/getSysUserList',
    method: 'post',
    params: query
  })
}


export function createObj(data) {
  return request({
    url: '/system/sysuser/addSysUser',
    method: 'post',
    params: data
  })
}

export function updateObj(data) {
  return request({
    url: '/system/sysuser/updateSysUser',
    method: 'post',
    params: data
  })
} 

export function deleteObj(data) {
  return request({
    url: '/system/sysuser/deleteSysUser',
    method: 'post',
    params: {id:data.id}
  })
} 

export function getRoles(uid){
  return request({
    url: '/system/sysrole/getSysRoleList',
    method: 'post',
    params:{uid:uid}
  })
}

export function getDeptTree(uid){
  return request({
    url: '/system/sysdept/getSysDeptList',
    method: 'post',
    params:{uid:uid}
  })
} 

export function updatePwd(data){
  return request({
    url: '/system/sysuser/changePsd',
    method: 'post',
    params: data
  })
}